/*
 * @Author: Starfish_DL
 * @Date: 2020-09-30 20:31:33
 * @LastEditors: Starfish_DL
 * @LastEditTime: 2020-09-30 20:33:19
 * @CurrentVersion: 1.0
 * @Description: 
 */

public class Person001 {
    String name;
    int age;
    boolean isMarried;

    //方法
    public void walk() {
        System.out.println("人走路...");
    }
        public String display() {
        return "名字是： "+name+", 年龄是： "+age+",  是否已婚： "+isMarried; 
    }

    //内部代码块
    { 
        name ="GoodBoy";
        age=20;
        isMarried = true;
    }

    //内部类
    class pet
    {
        String name = "dog";
        float weight = 10;
    }

    //执行代码
    public static void main(String args[]){
        Person001 p1 = new Person001();
        p1.walk();
        System.out.println(p1.display());
    }

}
